<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%base_job}}".
 *
 * @property int $id
 * @property string $job_name 岗位名称
 * @property int $status 状态【-1：删除; 0：禁用; 1：启用】
 * @property int $sort 排序（数字越小，越靠前）
 * @property int $operation_id 操作人ID
 * @property string $operation_name 操作人
 * @property int $created_at 添加时间
 * @property int $updated_at 更新时间
 */
class Job extends \common\models\base\BaseModel
{
    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 失效
    const STATUS_ENABLE = 1;// 正常

    public static $statuss = [
        self::STATUS_DELETE => '删除',
        self::STATUS_INVALID => '停用',
        self::STATUS_ENABLE => '启用',
    ];

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%base_job}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['status', 'sort', 'operation_id', 'created_at', 'updated_at'], 'integer'],
            [['job_name'], 'string', 'max' => 60],
            [['operation_name'], 'string', 'max' => 100],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'job_name' => '岗位名称',
            'status' => '状态【-1：删除; 0：禁用; 1：启用】',
            'sort' => '排序（数字越小，越靠前）',
            'operation_id' => '操作人ID',
            'operation_name' => '操作人',
            'created_at' => '添加时间',
            'updated_at' => '更新时间',
        ];
    }
}
